import {
	imageNowIP
} from "@/utils/config.js"
import ikunImage from "@/assets/ikun.webp"
export function handledImageError(data, code) {
	let url = ''
	if(data!=undefined){
		try{
			if (code == 1 && data.indexOf('/images/')!=-1) {
				url = imageNowIP + "/images/" + data.split('/images/')[1]
			} else {
				url = imageNowIP + "/imgs/" + data.split('/imgs/')[1]
			}
		}catch(e){
			url=ikunImage
			console.log("内部错误",code,data);
			console.error(e);
		}
	}
	return url
}